# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=toml-adapt
pkgver=0.3.0
pkgrel=0
pkgdesc="A simple command-line interface (CLI) for manipulating toml files"
url="https://github.com/firefly-cpp/toml-adapt"
arch="noarch"
license="MIT"
depends="python3 py3-toml py3-click"
checkdepends="py3-pytest-xdist"
makedepends="py3-gpep517 py3-poetry-core"
subpackages="$pkgname-doc $pkgname-pyc"
source="https://github.com/firefly-cpp/toml-adapt/archive/$pkgver/toml-adapt-$pkgver.tar.gz"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest -n auto
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/toml_adapt-$pkgver-py3-none-any.whl

	install -Dm644 toml-adapt.1 -t "$pkgdir"/usr/share/man/man1/
}

sha512sums="
1db6a11a8658bed3bae4707a24877edc60d7c10726763d6c111e094d431990c8e4528dfbe5bb0779d9c0dfee214fd3bfba259167dc874d1524c8d74b98c5f3b8  toml-adapt-0.3.0.tar.gz
"
